Change OziExplorer output to write \r\n pairs instead of \n.
authoralexmot <alexmot@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Tue, 9 Mar 2004 22:18:53 +0000 (22:18 +0000)
committeralexmot <alexmot@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Tue, 9 Mar 2004 22:18:53 +0000 (22:18 +0000)
gpsbabel/ozi.c
gpsbabel/reference/ozi.wpt

index 3de14fa1be425265e06cdbdad45fdaf00e177a0e..a2d5fbcd70af989fed5726b2f282f31523256ad1 100644 (file)
@@ -106,7 +106,7 @@ ozi_openfile(char *fname) {
         file_out = NULL;
     }
 
-    file_out = xfopen(tmpname, "w", MYNAME);
+    file_out = xfopen(tmpname, "wb", MYNAME);
 
     xfree(tmpname);
 
@@ -117,12 +117,12 @@ static void
 ozi_track_hdr(const route_head * rte)
 {
     static char *ozi_trk_header = 
-        "OziExplorer Track Point File Version 2.1\n"
-        "WGS 84\n"
-        "Altitude is in Feet\n"
-        "Reserved 3\n" 
-        "0,2,255,ComplimentsOfGPSBabel,0,0,2,8421376\n"
-        "0\n";
+        "OziExplorer Track Point File Version 2.1\r\n"
+        "WGS 84\r\n"
+        "Altitude is in Feet\r\n"
+        "Reserved 3\r\n" 
+        "0,2,255,ComplimentsOfGPSBabel,0,0,2,8421376\r\n"
+        "0\r\n";
 
     ozi_openfile(ozi_ofname);
     fprintf(file_out, ozi_trk_header);
@@ -144,7 +144,7 @@ ozi_track_disp(const waypoint * waypointp)
         alt_feet = (waypointp->altitude * 3.2808);
     }
 
-    fprintf(file_out, "%.6f,%.6f,0,%.0f,%.5f,,\n",
+    fprintf(file_out, "%.6f,%.6f,0,%.0f,%.5f,,\r\n",
             waypointp->latitude, waypointp->longitude, alt_feet, ozi_time);
 }
 
@@ -163,10 +163,10 @@ static void
 ozi_route_hdr(const route_head * rte)
 {
     static char *ozi_route_header = 
-        "OziExplorer Route File Version 1.0\n"
-        "WGS 84\n" 
-        "Reserved 1\n" 
-        "Reserved 2\n";
+        "OziExplorer Route File Version 1.0\r\n"
+        "WGS 84\r\n" 
+        "Reserved 1\r\n" 
+        "Reserved 2\r\n";
 
     /* prologue on 1st pass only */
     if (route_out_count == 0) {
@@ -188,7 +188,7 @@ ozi_route_hdr(const route_head * rte)
      * R, 1, ICP GALHETA,, 16711680 
      */
      
-     fprintf(file_out, "R,%d,%s,%s,\n", 
+     fprintf(file_out, "R,%d,%s,%s,\r\n", 
          route_out_count, 
          rte->rte_name ? rte->rte_name : "", 
          rte->rte_desc ? rte->rte_desc : "");
@@ -232,7 +232,7 @@ ozi_route_disp(const waypoint * waypointp)
  * W,1,7,7,007,-25.581670,-48.316660,36564.54196,10,1,4,0,65535,TR ILHA GALHETA,0,0 
  */
 
-    fprintf(file_out, "W,%d,%d,,%s,%.6f,%.6f,%.5f,0,1,3,0,65535,%s,0,0\n", 
+    fprintf(file_out, "W,%d,%d,,%s,%.6f,%.6f,%.5f,0,1,3,0,65535,%s,0,0\r\n", 
             route_out_count,
             route_wpt_count,
             waypointp->shortname ? waypointp->shortname : "",
@@ -650,7 +650,7 @@ ozi_waypt_pr(const waypoint * wpt)
     index++;
 
     fprintf(file_out,
-            "%d,%s,%.6f,%.6f,%.5f,%d,%d,%d,%d,%d,%s,%d,%d,%d,%.0f,%d,%d,%d\n",
+            "%d,%s,%.6f,%.6f,%.5f,%d,%d,%d,%d,%d,%s,%d,%d,%d,%.0f,%d,%d,%d\r\n",
             index, shortname, wpt->latitude, wpt->longitude, ozi_time, 0,
             1, 3, 0, 65535, description, 0, 0, 0, alt_feet, 6, 0, 17);
 
@@ -663,10 +663,10 @@ static void
 data_write(void)
 {
     static char *ozi_wpt_header = 
-        "OziExplorer Waypoint File Version 1.1\n"
-        "WGS 84\n" 
-        "Reserved 2\n" 
-        "Reserved 3\n";
+        "OziExplorer Waypoint File Version 1.1\r\n"
+        "WGS 84\r\n" 
+        "Reserved 2\r\n" 
+        "Reserved 3\r\n";
 
     track_out_count = route_out_count = 0;
     
index ea65058c42e8b1e8aa882e0d0e4214800603841d..5b3f02df721386585495a3f48e0282aa4920ed74 100644 (file)
@@ -1,13 +1,13 @@
-OziExplorer Waypoint File Version 1.1
-WGS 84
-Reserved 2
-Reserved 3
-1,GCEBB,35.972033,-87.134700,25569.00000,0,1,3,0,65535,Mountain Bike Heaven by susy1313,0,0,0,0,6,0,17
-2,GC1A37,36.090683,-86.679550,25569.00000,0,1,3,0,65535,The Troll by a182pilot & Family,0,0,0,0,6,0,17
-3,GC1C2B,35.996267,-86.620117,25569.00000,0,1,3,0,65535,Dive Bomber by JoGPS & family,0,0,0,0,6,0,17
-4,GC25A9,36.038483,-86.648617,25569.00000,0,1,3,0,65535,FOSTER by JoGPS & Family,0,0,0,0,6,0,17
-5,GC2723,36.112183,-86.741767,25569.00000,0,1,3,0,65535,Logan Lighthouse by JoGps & Family,0,0,0,0,6,0,17
-6,GC2B71,36.064083,-86.790517,25569.00000,0,1,3,0,65535,Ganier Cache by Susy1313,0,0,0,0,6,0,17
-7,GC309F,36.087767,-86.809733,25569.00000,0,1,3,0,65535,Shy's Hill by FireFighterEng33,0,0,0,0,6,0,17
-8,GC317A,36.057500,-86.892000,25569.00000,0,1,3,0,65535,GittyUp by JoGPS / Warner Parks,0,0,0,0,6,0,17
-9,GC317D,36.082800,-86.867283,25569.00000,0,1,3,0,65535,Inlighting by JoGPS / Warner Parks,0,0,0,0,6,0,17
+OziExplorer Waypoint File Version 1.1\r
+WGS 84\r
+Reserved 2\r
+Reserved 3\r
+1,GCEBB,35.972033,-87.134700,25569.00000,0,1,3,0,65535,Mountain Bike Heaven by susy1313,0,0,0,0,6,0,17\r
+2,GC1A37,36.090683,-86.679550,25569.00000,0,1,3,0,65535,The Troll by a182pilot & Family,0,0,0,0,6,0,17\r
+3,GC1C2B,35.996267,-86.620117,25569.00000,0,1,3,0,65535,Dive Bomber by JoGPS & family,0,0,0,0,6,0,17\r
+4,GC25A9,36.038483,-86.648617,25569.00000,0,1,3,0,65535,FOSTER by JoGPS & Family,0,0,0,0,6,0,17\r
+5,GC2723,36.112183,-86.741767,25569.00000,0,1,3,0,65535,Logan Lighthouse by JoGps & Family,0,0,0,0,6,0,17\r
+6,GC2B71,36.064083,-86.790517,25569.00000,0,1,3,0,65535,Ganier Cache by Susy1313,0,0,0,0,6,0,17\r
+7,GC309F,36.087767,-86.809733,25569.00000,0,1,3,0,65535,Shy's Hill by FireFighterEng33,0,0,0,0,6,0,17\r
+8,GC317A,36.057500,-86.892000,25569.00000,0,1,3,0,65535,GittyUp by JoGPS / Warner Parks,0,0,0,0,6,0,17\r
+9,GC317D,36.082800,-86.867283,25569.00000,0,1,3,0,65535,Inlighting by JoGPS / Warner Parks,0,0,0,0,6,0,17\r